module CanCamel::Validators
  module ValidatorsHelper
    def validate_element(element:, value:)
      if value.is_a? Proc
        raise ValidationError unless value.call element
        return
      end
      raise ValidationError unless element.to_s == value.to_s
    end
  end
end
